//
//  GGTopReusableView.m
//  Gunterapple
//
//  Created by 热带雨林 on 2020/4/4.
//  Copyright © 2020 热带雨林. All rights reserved.
//

#import "GGTopReusableView.h"
#import "GGAddtion.h"
#import "GGHomeTopView.h"
#import "GDLoopView.h"
@interface GGTopReusableView ()<HomeTopViewDelegate>

@end
@implementation GGTopReusableView
- (instancetype)initWithFrame:(CGRect)frame{
    if(self = [super initWithFrame:frame]){
        [self setUI];
    }
    return self;
}
- (void)setUI{
    self.backgroundColor = [UIColor whiteColor];
    GGHomeTopView *topView = [[GGHomeTopView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.frame), 100)];
    topView.delegate = self;
    [self addSubview:topView];
    NSArray *imagaArray = @[@"Home_Scroll_01",@"Home_Scroll_02",@"Home_Scroll_03",@"Home_Scroll_04",@"Home_Scroll_05"];
    GDLoopView *loopView = [[GDLoopView alloc]initWithImageArray:imagaArray];
    [self addSubview:loopView];
    loopView.frame = CGRectMake(0, topView.frame.size.height, CGRectGetWidth(self.frame), 120);
}
- (void)clickBtnWithType:(NSInteger)type{
    if([self.delegate respondsToSelector:@selector(btnWithType:)]){
        [self.delegate btnWithType:type];
    }
}
@end

